﻿<div class="page-header">
    <h1>Requests list</h1>
</div>

<div data-ng-controller="HomeCtrl" class="app-requests">
    <table class="table table-hover">
        <thead>
            <tr>
                <!--th class="col-md-1">Orders</th-->
                <th class="col-md-2">Approvers</th>
                <th class="col-md-1">Country</th>
                <th class="col-md-1">City</th>
                <th class="col-md-1">Company</th>
                <th class="col-md-1">Purpose</th>
                <th class="col-md-1">FinYear</th>
                <th class="col-md-1">Training</th>
                <th class="col-md-1">Details</th>
                <th class="col-md-2">Travelers</th>
                <th class="col-md-1"></th>
            </tr>
        </thead>
        <tbody>
            <tr data-ng-repeat="Request in Requests" id="request-{{Request.Id}}">
                <!--td class="col-md-1">{{Request.Orders}}</td-->
                <td class="col-md-2" style="white-space: nowrap"><span data-ng-repeat="Approver in Request.Approvers">{{Approver.Title}};<br /></span></td>
                <td class="col-md-1" style="white-space: nowrap"><span data-ng-repeat="Country in Request.Country">{{Country.Label}};<br /></span></td>
                <td class="col-md-1">{{Request.City}}</td>
                <td class="col-md-1">{{Request.Company}}</td>
                <td class="col-md-1" style="white-space: nowrap"><span data-ng-repeat="Purpose in Request.Purpose">{{Purpose.Label}};<br /></span></td>
                <td class="col-md-1" style="white-space: nowrap"><span data-ng-repeat="FinYear in Request.FinYear">{{FinYear.Label}};<br /></span></td>
                <td class="col-md-1" style="white-space: nowrap"><span data-ng-repeat="Training in Request.Training">{{Training.Label}};<br /></span></td>
                <td class="col-md-1">{{Request.Details}}</td>
                <td class="col-md-2" style="white-space: nowrap"><span data-ng-repeat="Traveler in Request.Travelers">{{Traveler.Title}};<br /></span></td>
                <td class="col-md-1">
                    <a class="btn btn-warning btn-xs" href="#/edit/{{Request.Id}}">
                        <span class="glyphicon glyphicon-pencil"></span> Edit
                    </a>
                    <a class="btn btn-danger btn-xs" data-ng-click="deleteRequest($event, Request.Id)">
                        <span class="glyphicon glyphicon-remove"></span> Delete
                    </a>
                </td>
            </tr>
        </tbody>
    </table>
    <div ng-class="{'app-loading': !HomeController.Requests.RequestsLoaded}"></div>
</div>
